/* __________              _____                                                *\
** \______   \____   _____/ ____\____   ____    Copyright (c) 2017-2023 Ponfee  **
**  |     ___/  _ \ /    \   __\/ __ \_/ __ \   http://www.ponfee.cn            **
**  |    |  (  <_> )   |  \  | \  ___/\  ___/   Apache License Version 2.0      **
**  |____|   \____/|___|  /__|  \___  >\___  >  http://www.apache.org/licenses/ **
**                      \/          \/     \/                                   **
\*                                                                              */

package cn.ponfee.disjob.common.base;

/**
 * Generate id
 *
 * @author Ponfee
 */
@FunctionalInterface
public interface IdGenerator {

    /**
     * Returns long id.
     *
     * @return id long value
     */
    long generateId();

    /**
     * Returns string id.
     *
     * @return id string value
     */
    default String generateIdAsString() {
        return Long.toString(generateId());
    }
}
